<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<script>

function validateName() {
	var txtName = $('te_name');
	var msgName = $('msgName');

	if (txtName.value == '') {
		msgName.innerText = 'Bạn cần nhập tên.';
		msgName.style.display = 'block';
		return false;
	}
	
	msgName.style.display = 'none';
	return true;
}

</script>

<input type="hidden" name="mode" value="editInfo"></input>
<p><label>Tên: <input type="text" name="ti_name" 
		value="${(empty param.ti_name) ? test.name : param.ti_name}"></input></label>
	<span id="msgName" style='${(empty nameErr) ? "none" : "block"}'>${nameErr}</span>
</p>
<p><label>Mô tả: <textarea name="ti_description">${(empty param.ti_name) ? test.description : param.ti_description}</textarea></label></p>
<p><button type="submit" name="ti_submit" value="update">Lưu</button>
<button type="button" onclick="location.href='${scriptPath}?action=test.view&id=${test.id}'">Thôi</button></p>
